package com.qk.management.mapper;
import com.qk.entity.Course;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface CourseMapper {

    List<Course> selectList(Object o);
    Integer count(@Param("name")String name,
                  @Param("subject")Integer subject,
                  @Param("target")Integer target);
    List<Course> selectByPage(@Param("name") String name,
                              @Param("subject")Integer subject,
                              @Param("target")Integer target,
                              @Param("offSet")Integer offSet,
                              @Param("pageSize")Integer pageSize);

    @Insert("insert into course(name,subject,target,price,description,create_time,update_time) values(#{name},#{subject},#{target},#{price},#{description},#{createTime},#{updateTime})")
    void insert(Course course);

    void deleteById(Integer id);

    Course findById(Integer id);

    void update(Course course);
}
